package com.cictec.middleware.feign.gps.caculate;

import java.util.Date;
import java.util.List;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.cictec.middleware.gps.engine.TimingPoint;
import com.cictec.middleware.gps.engine.caculate.entity.BusMileage;
import com.cictec.middleware.gps.engine.caculate.entity.BusTrip;

/**
 * 中间件位置分析服务
 * 
 * @author Administrator
 *
 */
@Component
@FeignClient(name = "middleware-gps-caculate")
public interface MiddlewareGpsCaculateService {

	/**
	 * 根据时序点计算里程信息，按照里程状态区分
	 * 
	 * @param position
	 * @return
	 */
	@RequestMapping(value = "/gps/caculate/caculateMileage")
	public List<BusMileage> caculateMileage(List<TimingPoint> timingPoints);
	
	/**
	 * 根据时序点计算里程信息，按照里程状态区分
	 * 
	 * @param position
	 * @return
	 */
	@RequestMapping(value = "/gps/caculate/caculateMileage/devCode")
	public List<BusMileage> caculateMileage(@RequestParam("devCode") String devCode, @RequestParam("startTime") Date startTime, @RequestParam("endTime") Date endTime);
	
	/**
	 * 获取上一个完成的趟次信息
	 * @param devCode
	 * @param endTime
	 * @return
	 */
	@RequestMapping(value = "/gps/caculate/getLastBusTrip")
	public BusTrip getLastBusTrip(@RequestParam("devCode") String devCode, @RequestParam("endTime") Date endTime);

}
